import { Router } from "jsr:@oak/oak/router";
import { authMiddleware } from "../middleware/authMiddleware.ts";
import { adminOnly } from "../middleware/adminOnly.ts";
import { getAuth } from "../services/auth.ts";
import type { ApiResponse } from "../shared/types.ts";

const router = new Router();

router.delete("/api/admin/users/:id", authMiddleware, adminOnly, async (ctx) => {
  const { id } = ctx.params;
  
  const auth = getAuth();
  await auth.deleteUser(id);
  
  const response: ApiResponse<null> = {
    success: true,
    data: null
  };
  
  ctx.response.body = response;
});

export default router; 